package com.demo.base.bean;


/**
 * 带有一个data字段的输出值
 * Created by ethan on 2016/7/6.
 */
public class DataOutput<T> extends BaseOutput {

    private T data;

    public DataOutput() {
        this(null);
    }

    public DataOutput(T data) {
        super();
        this.data = data;
    }

    public DataOutput(String message, T data) {
        super(message);
        this.data = data;
    }

    public DataOutput(OutputStatus status, T data) {
        super(status);
        this.data = data;
    }

    public DataOutput(OutputStatus status, String message, T data) {
        super(status, message);
        this.data = data;
    }

    public DataOutput(String status, String message, T data) {
        super(status, message);
        this.data = data;
    }


    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public T safeGetData() {
        ensureSuccess();
        return this.data;
    }
}